﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="cbsglInfo.aspx.cs" Inherits="Catering.Catering_Page.richang.cbsglInfo" %>

<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script src="../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <link rel="stylesheet" type="text/css" href="../../../Style/head.css" />
    <link rel="stylesheet" type="text/css" href="../../../Style/center.css" />

    <link href="../../../Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/zhezhao.js" type="text/javascript"></script>
    <link href="../../../Style/tinybox_style.css" rel="stylesheet" type="text/css" />
    <script src="../../../Style/xxk.js" type="text/javascript"></script>
    <link href="../../Style/sysData.css" rel="stylesheet" type="text/css" />
    <script src="../../Scripts/Calendar.js" type="text/javascript"></script>
    <style type="text/css">
        .Create_Recipe
        {
            margin-top: 0;
        }
        .Create_Recipe
        {
            border: 1px solid #159aec;
            border-top: none;
            width: 993px;
            padding-left: 5px;
            min-height: 400px;
        }
        .page
        {
            width: 240px;
            margin: 0px auto;
        }
        .table_td_120 td
        {
            padding: 5px 0px;
        }
    </style>
    <script type="text/javascript">

        //显示添加
        function Add() {
            $("#btnEdit").hide();
            $("#btnAdd").show();
            divshow("div_main_info", "bg");
        }

        //显示修改
        function Edit(cid) {
            $("#HidID").val(cid);
            cbsglInfo.GetPersonnel(cid, LoadPersonnel);
        }

        function LoadPersonnel(data) {
            if (data.value == null) {
                return;
            }
            var ds = data.value;
            if (ds != null && ds.Rows[0] != undefined && typeof (ds) == "object") {
                $("#txt_info_name").val(ds.Rows[0].CName);
                $("#txt_info_zyq").val(ds.Rows[0].GroupID);
                $("#txt_info_kh").val(ds.Rows[0].CardNo);
                $("#txt_info_zjmc").val(ds.Rows[0].JobCard);
                $("#txt_info_zjqj").val(ds.Rows[0].Effective);
                $("#txt_info_zjqj_end").val(ds.Rows[0].EffectiveEnd);
                $("#txt_info_tel").val(ds.Rows[0].Tel);
                $("#txt_info_yxqj").val(ds.Rows[0].EffectiveArea);
                $("#btnEdit").show();
                $("#btnAdd").hide();
                divshow("div_main_info", "bg");
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:HiddenField ID="HidID" runat="server" />
    <div class="xxk_button">
    </div>
    <div class="Center_Content">
        <div class="Create_Recipe">
            <div class="btn_list" style="height:30px;">
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td align="right" height="30">
                            <input type="button" value="添加" onclick="Add()" class="input_btn_a" />
                        </td>
                        <td width="10">&nbsp;</td>
                    </tr>
                </table>
            </div>
            <div class="data_css" style="border: 0px; height: auto;">
                <table width="100%" border="1" cellpadding="0" cellspacing="0">
                    <thead>
                        <tr>
                            <th>
                                姓名
                            </th>
                            <th>
                                负责作业区
                            </th>
                            <th>
                                跟踪卡号
                            </th>
                            <th>
                                工作证件名称
                            </th>
                            <th colspan="2">
                                工作证件有效区间
                            </th>
                            <th>
                                电话
                            </th>
                            <th>
                                有效人员
                            </th>
                            <th>
                                编辑
                            </th>
                            <th>
                                删除
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        <asp:Repeater ID="Rep_Personnel" runat="server" OnItemCommand="Rep_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <%#Eval("CName")%>
                                    </td>
                                    <td>
                                        <%#Eval("GroupID")%>
                                    </td>
                                    <td>
                                        <%#Eval("CardNo")%>
                                    </td>
                                    <td>
                                        <%#Eval("JobCard")%>
                                    </td>
                                    <td>
                                        <%#Eval("Effective")%>&nbsp;
                                    </td>
                                    <td>
                                        <%#Eval("EffectiveEnd")%>&nbsp;
                                    </td>
                                    <td>
                                        <%#Eval("Tel")%>
                                    </td>
                                    <td>
                                        <%#Eval("EffectiveArea")%>
                                    </td>
                                    <td>
                                        <img src="../../Images/file.gif" onclick="Edit('<%#Eval("id")%>')" style="cursor: pointer;" />
                                    </td>
                                    <td>
                                        <asp:ImageButton ID="img_btn" runat="server" ImageUrl="../../Images/trash.gif" OnClientClick="return confirm('确认删除？');"
                                            CommandArgument='<%#Eval("id")%>' CommandName="del" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </tbody>
                </table>
            </div>
            <div class="page">
                <webdiyer:AspNetPager ID="AspNetPager1" runat="server" PageSize="10" OnPageChanging="AspNetPager1_PageChanging"
                    FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" ShowPageIndex="true"
                    NumericButtonCount="6">
                </webdiyer:AspNetPager>
            </div>
            <!--弹出层-->
            <div id="bg" class="bg">
            </div>
            <div id="div_main_info" class="center_div" style="padding: 10px 0px; margin-top: -130px; width: 750px;">
                <table width="100%" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td height="34" align="right">姓名：</td>
                        <td width="160">
                            <asp:TextBox ID="txt_info_name" runat="server" CssClass="input_bg"></asp:TextBox>
                        </td>
                        <td align="right" width="75">
                            负责作业区：
                        </td>
                        <td width="150">
                            <asp:DropDownList runat="server" ID="txt_info_zyq" CssClass="select_input_bg" Width="142"></asp:DropDownList>
                        </td>
                        <td align="right" width="75">
                            跟踪卡号：
                        </td>
                        <td width="160">
                            <asp:TextBox ID="txt_info_kh" runat="server" CssClass="input_bg"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td height="34" align="right">
                            工作证件名称：
                        </td>
                        <td>
                            <asp:TextBox ID="txt_info_zjmc" runat="server" CssClass="input_bg"></asp:TextBox>
                        </td>
                        <td align="right">
                            电话：
                        </td>
                        <td colspan="3">
                            <asp:TextBox ID="txt_info_tel" runat="server" CssClass="input_bg" Width="140"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td height="34" align="right">
                            工作证件有效区间：
                        </td>
                        <td colspan="5" valign="middle">
                            <asp:TextBox ID="txt_info_zjqj" runat="server" CssClass="input_bg" onfocus="calendar();"></asp:TextBox>
                            至
                            <asp:TextBox ID="txt_info_zjqj_end" runat="server" CssClass="input_bg" onfocus="calendar();"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td height="60" align="right" >
                            有效人员：
                        </td>
                        <td colspan="5">
                            <asp:TextBox ID="txt_info_yxqj" runat="server" CssClass="input_bg" TextMode="MultiLine"
                                Style="width:606px; height: 40px"></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <table width="100%">
                    <tr>
                        <td align="right">
                            <asp:Button ID="btnAdd" runat="server" Text="提交" CssClass="input_btn_a" OnClick="btnAdd_Click" />
                            <asp:Button ID="btnEdit" runat="server" Text="提交" CssClass="input_btn_a" OnClick="btnEdit_Click" />
                        </td>
                        <td align="left">
                            <input type="button" id="Button3" value="关闭" class="input_btn_a" onclick="divhidel('div_main_info', 'bg');" />
                        </td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    <div class="footer">
        <strong>中海油能源发展配餐服务公司渤海自营油田作业公司&nbsp;&nbsp;版权所有@CopyRight 2012</strong><span>技术支持：北京天择嘉业科技有限公司</span>
    </div>
    </form>
</body>
</html>
